from rest_framework.viewsets import ModelViewSet

from misc.models import (QuestionAnswer, RSAPublicKey, Text,
                         UpgradePackageDelivery, UpgradePackageResult)
from misc.serializers import (QuestionAnswerSerializer, RSAPublicKeySerializer,
                              TextSerializer, UpgradePackageDeliverySerializer,
                              UpgradePackageResultSerializer)


class QuestionAnswerViewSet(ModelViewSet):
    queryset = QuestionAnswer.objects.all()
    serializer_class = QuestionAnswerSerializer


class RSAPublicKeyViewSet(ModelViewSet):
    queryset = RSAPublicKey.objects.all()
    serializer_class = RSAPublicKeySerializer


class TextViewSet(ModelViewSet):
    queryset = Text.objects.all()
    serializer_class = TextSerializer


class UpgradePackageDeliveryViewSet(ModelViewSet):
    queryset = UpgradePackageDelivery.objects.all()
    serializer_class = UpgradePackageDeliverySerializer


class UpgradePackageResultViewSet(ModelViewSet):
    queryset = UpgradePackageResult.objects.all()
    serializer_class = UpgradePackageResultSerializer
